<template>
  <div class="shell">
    <!-- 显示子路由 -->
    <div class="shell-page">
      <router-view></router-view>
    </div>

    <!-- 显示底部按钮组 -->
    <div class="shell-nav">
      <van-tabbar v-model="active" route>
        <van-tabbar-item
          v-for="item in NAVS"
          :icon="item.icon"
          :name="item.value"
          :to="item.path"
        >
          {{ item.name }}
        </van-tabbar-item>
      </van-tabbar>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";
import { NAVS, NAV_TYPE } from "@/config/navs";

const active = ref(NAV_TYPE.HOME);
</script>

<style lang="less" scoped>
.shell {
  background: #f5f5f5;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.shell-page {
  flex: 1;
  height: 0;
}
.shell-nav {
  background: #fff;
}
</style>
